import flash.display.Loader;

class Example {
	static var _instance : Example;
	static function main () : Void {
		_instance = new Example();
	}
	
	public function new () {
		var data = new ExampleFiles();
		var layout = data.getFile( "layout.xml" );
		var xml = Xml.parse( layout.readMultiByte( layout.length, "utf-8" ) );
		for( child in xml.elements() ) {
			if( child.nodeName == "image" ) {
				var name = child.get( "name" );
				var x = Std.parseInt( child.get( "x" ) );
				var y = Std.parseInt( child.get( "y" ) );
				var loader = new Loader();
				loader.loadBytes( data.getFile( name ) );
				loader.x = x;
				loader.y = y;
				
				flash.Lib.current.addChild( loader );
			}
		}
	}
}

class ExampleFiles extends SwfFS {}

